#!/bin/bash
#
now=$(date +%s)
for proc_id in $(ps -eo pid | sed '1d');do
  #获取进程的启动时间
    proc_start_time=$(ps -p $proc_id -o lstart=)
    proc_start_timestap=$(date -d "$proc_start_time" +%s)
    #判断是否是十分钟内启动
    let offset=now-proc_start_timestap
    if [ $offset -lt 600 ]; then
       echo "进程id：$proc_id,进程名称: $(ps -p ${proc_id} -o comm=)"
    fi
done 
   


